package com.itheima.test2;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

/*
复制文件
使用 文件字节输入输出流
一次复制一个数组
 */
public class Test02 {

    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("C:\\Users\\Administrator\\Desktop\\美女\\meinv2.jpg");
        FileOutputStream fos = new FileOutputStream("day12\\copy\\meinv2.jpg");

        long start = System.currentTimeMillis();
        byte[] bytes = new byte[1024];//1kb
        int len;
       // int  count=0;
        while ((len=fis.read(bytes))!=-1){
            //bytes 0,len
            fos.write(bytes,0,len);
           // count++;
        }
        long end = System.currentTimeMillis();
        System.out.println(end-start);//10

     //   System.out.println(count);

        fis.close();
        fos.close();

    }
}
